import qs from 'qs';
import http from '@/utils/axios/axios'
import {setStorage, getStorage} from '@/utils/tools/tools'


let  userTemp ={};

// 新增电子病历信息
export function addMedicalRecord(data) {
  return http.post(`/temr/medicalRecord/addMedicalRecord`, data)
}

// 编辑电子病历信息
export function editMedicalRecord(data) {
  return http.post(`/temr/medicalRecord/editMedicalRecord`, data)
}

// 分页查询电子病历信息
export function pageQueryMedicalRecord(data) {
  return http.post(`/temr/medicalRecord/pageQueryMedicalRecord`, data)
}

// 添加病例截图
export function uploadBase64(data) {
  //return http.post(`/temr/medicalRecord/uploadBase64`, data)
  userTemp = getStorage('user');
  if(typeof userTemp.sessionId !== 'undefined'){
    return http.post(`/temr/medicalRecord/uploadBase64`, data)
  }else{
    return new Promise((resolve,reject)=>{
      resolve({data:{status:-1}});
    });
  }
}

// 分页查询电子病历信息
export function queryMedicalRecordOne(data) {
  return http.get(`/temr/medicalRecord/filterSkip/queryMedicalRecordOne/${data.id}`, {params: data})
}

// 编辑电子病历信息
export function uploadModelColorBase64(data) {
  return http.post(`/temr/medicalRecord/filterSkip/uploadModelColorBase64`, data)
}

//上传图文报告文件
export function uploadQraphicReport(data) {
  return http.post(`/temr/file/uploadQraphicReport`, data)
}
